/*                                  ATELIER                                   */

/* %%LICENSE_TAG%%                                                            */
package edu.gmu.view.cube;

import edu.gmu.atelier.AffineVector;
import java.awt.Graphics2D;
import javax.swing.JComponent;

/*******************************************************************
 * Cube represents 4 vertexes and 4 lines connecting them.
 * @author  James H. Pope
 * @version $Id:$
 *******************************************************************/
public class Face //implements Sprite
{
    /**
     * vertices
     */
    private AffineVector a = null;
    private AffineVector b = null;
    private AffineVector c = null;
    private AffineVector d = null;
    
    /**
     * Creates a new Face with specified parameters.
     * @param size width/height
     */
    public Face( int size )
    {
        // Arrange counter-clockwise so that normal is +/- z?
        this.a = new AffineVector(  0.0,  0.0,  0.0 );
        this.b = new AffineVector( size,  0.0,  0.0 );
        this.c = new AffineVector( size, size,  0.0 );
        this.d = new AffineVector(  0.0, size,  0.0 );
    }

    /**
     * Creates a new Face with specified parameters.
     * @param a (lower left)
     * @param b (lower right)
     * @param c (upper right)
     * @param d (upper left)
     */
    public Face( AffineVector a, AffineVector b, AffineVector c, AffineVector d )
    {
        this.a = a;
        this.b = b;
        this.c = c;
        this.d = d;
    }
    
    
    /*********************************************************************
     * Paints images on specified Component object using passed Graphics.
     * @param component
     * @param pen
     *********************************************************************/
    public void draw( Pen pen )
    {
        pen.drawLine(a, b);
        pen.drawLine(b, c);
        pen.drawLine(c, d);
        pen.drawLine(d, a);
    }
     
}

/*                                  ATELIER                                   */
